class InfoModel {
  int errno;
  Data data;
  String errmsg;

  InfoModel({this.errno, this.data, this.errmsg});

  InfoModel.fromJson(Map<String, dynamic> json) {
    errno = json['errno'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    errmsg = json['errmsg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errno'] = this.errno;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['errmsg'] = this.errmsg;
    return data;
  }
}

class Data {
  List<Address> address;
  User user;

  Data({this.address, this.user});

  Data.fromJson(Map<String, dynamic> json) {
    if (json['address'] != null) {
      address = new List<Address>();
      json['address'].forEach((v) {
        address.add(new Address.fromJson(v));
      });
    }
    user = json['user'] != null ? new User.fromJson(json['user']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.address != null) {
      data['address'] = this.address.map((v) => v.toJson()).toList();
    }
    if (this.user != null) {
      data['user'] = this.user.toJson();
    }
    return data;
  }
}

class Address {
  int id;
  String name;
  int userId;
  String province;
  String city;
  String county;
  String addressDetail;
  String areaCode;
  String postalCode;
  String tel;
  bool isDefault;
  String addTime;
  String updateTime;
  bool deleted;

  Address(
      {this.id,
      this.name,
      this.userId,
      this.province,
      this.city,
      this.county,
      this.addressDetail,
      this.areaCode,
      this.postalCode,
      this.tel,
      this.isDefault,
      this.addTime,
      this.updateTime,
      this.deleted});

  Address.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    userId = json['userId'];
    province = json['province'];
    city = json['city'];
    county = json['county'];
    addressDetail = json['addressDetail'];
    areaCode = json['areaCode'];
    postalCode = json['postalCode'];
    tel = json['tel'];
    isDefault = json['isDefault'];
    addTime = json['addTime'];
    updateTime = json['updateTime'];
    deleted = json['deleted'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['userId'] = this.userId;
    data['province'] = this.province;
    data['city'] = this.city;
    data['county'] = this.county;
    data['addressDetail'] = this.addressDetail;
    data['areaCode'] = this.areaCode;
    data['postalCode'] = this.postalCode;
    data['tel'] = this.tel;
    data['isDefault'] = this.isDefault;
    data['addTime'] = this.addTime;
    data['updateTime'] = this.updateTime;
    data['deleted'] = this.deleted;
    return data;
  }
}

class User {
  int id;
  String username;
  int gender;
  int userLevel;
  String nickname;
  String mobile;
  String avatar;

  User(
      {this.id,
      this.username,
      this.gender,
      this.userLevel,
      this.nickname,
      this.mobile,
      this.avatar});

  User.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    username = json['username'];
    gender = json['gender'];
    userLevel = json['userLevel'];
    nickname = json['nickname'];
    mobile = json['mobile'];
    avatar = json['avatar'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['username'] = this.username;
    data['gender'] = this.gender;
    data['userLevel'] = this.userLevel;
    data['nickname'] = this.nickname;
    data['mobile'] = this.mobile;
    data['avatar'] = this.avatar;
    return data;
  }
}